import request from '@/config/axios'

// 派单系统 批量付款单记录 VO
export interface PaymentBatchVO {
  id: number // 订单编号
  dispatchPaymentIds: string // 付款编号集合
  deductionAmount: number // 抵扣金额
  amount: number // 合计金额
  paidAmount: number // 未付金额
  storeName: string // 门店名称
  imgUrl: string // 付款图片信息
  storeId: number // 服务编号
  remark: string // 备注
  status: number // 开启状态
  sort: number // 排序
}

// 派单系统 批量付款单记录 API
export const PaymentBatchApi = {
  // 查询派单系统 批量付款单记录分页
  getPaymentBatchPage: async (params: any) => {
    return await request.get({ url: `/dispatch/payment-batch/page`, params })
  },

  // 查询派单系统 批量付款单记录详情
  getPaymentBatch: async (id: number) => {
    return await request.get({ url: `/dispatch/payment-batch/get?id=` + id })
  },

  // 新增派单系统 批量付款单记录
  createPaymentBatch: async (data: PaymentBatchVO) => {
    return await request.post({ url: `/dispatch/payment-batch/create`, data })
  },

  // 修改派单系统 批量付款单记录
  updatePaymentBatch: async (data: PaymentBatchVO) => {
    return await request.put({ url: `/dispatch/payment-batch/update`, data })
  },

  updatePaidAmount: async (data: PaymentBatchVO) => {
    return await request.put({ url: `/dispatch/payment-batch/updatePaidAmount`, data })
  },

  handlePic: async (data: PaymentBatchVO) => {
    return await request.put({ url: `/dispatch/payment-batch/handlePic`, data })
  },

  handleRemark: async (data: PaymentBatchVO) => {
    return await request.put({ url: `/dispatch/payment-batch/handleRemark`, data })
  },

  updateDeductionAmount: async (data: PaymentBatchVO) => {
    return await request.put({ url: `/dispatch/payment-batch/updateDeductionAmount`, data })
  },

  // 删除派单系统 批量付款单记录
  deletePaymentBatch: async (id: number) => {
    return await request.delete({ url: `/dispatch/payment-batch/delete?id=` + id })
  },

  // 导出派单系统 批量付款单记录 Excel
  exportPaymentBatch: async (params) => {
    return await request.download({ url: `/dispatch/payment-batch/export-excel`, params })
  },
}
